Optimal. Leaf size=73 \[ \frac{a^2 \cos (c+d x)}{d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-2 a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.129619, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2872, 3767, 8, 3768, 3770, 2638} \[ \frac{a^2 \cos (c+d x)}{d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-2 a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2872
Rule 3767
Rule 8
Rule 3768
Rule 3770
Rule 2638
Rubi steps
\begin{align*} \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac{\int \left (-2 a^4+2 a^4 \csc ^2(c+d x)+a^4 \csc ^3(c+d x)-a^4 \sin (c+d x)\right ) \, dx}{a^2}\\ &=-2 a^2 x+a^2 \int \csc ^3(c+d x) \, dx-a^2 \int \sin (c+d x) \, dx+\left (2 a^2\right ) \int \csc ^2(c+d x) \, dx\\ &=-2 a^2 x+\frac{a^2 \cos (c+d x)}{d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}+\frac{1}{2} a^2 \int \csc (c+d x) \, dx-\frac{\left (2 a^2\right ) \operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-2 a^2 x-\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac{a^2 \cos (c+d x)}{d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.65086, size = 102, normalized size = 1.4 \[ \frac{a^2 \left (8 \cos (c+d x)+8 \tan \left (\frac{1}{2} (c+d x)\right )-8 \cot \left (\frac{1}{2} (c+d x)\right )-\csc ^2\left (\frac{1}{2} (c+d x)\right )+\sec ^2\left (\frac{1}{2} (c+d x)\right )+4 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-4 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-16 c-16 d x\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.073, size = 93, normalized size = 1.3 \begin{align*}{\frac{{a}^{2}\cos \left ( dx+c \right ) }{2\,d}}+{\frac{{a}^{2}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}-2\,{a}^{2}x-2\,{\frac{{a}^{2}\cot \left ( dx+c \right ) }{d}}-2\,{\frac{c{a}^{2}}{d}}-{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.72393, size = 140, normalized size = 1.92 \begin{align*} -\frac{8 \,{\left (d x + c + \frac{1}{\tan \left (d x + c\right )}\right )} a^{2} - a^{2}{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a^{2}{\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.73496, size = 352, normalized size = 4.82 \begin{align*} -\frac{8 \, a^{2} d x \cos \left (d x + c\right )^{2} - 4 \, a^{2} \cos \left (d x + c\right )^{3} - 8 \, a^{2} d x - 8 \, a^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, a^{2} \cos \left (d x + c\right ) +{\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) -{\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{4 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.45154, size = 173, normalized size = 2.37 \begin{align*} \frac{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 16 \,{\left (d x + c\right )} a^{2} + 4 \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 8 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{16 \, a^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1} - \frac{6 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 8 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2}}}{8 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]